package com.pattern.objectcreator.builder;

/**
 * @author yangguanzan
 * @date 3/28/22
 * @description 装修工程的控制和安排
 */
public class DecorationDirector {

    private BaseDecorationBuilder builder;

    public DecorationDirector(BaseDecorationBuilder builder) {
        this.builder = builder;
    }

    //装修的安排，例如顺序或者其他公共配置要求等等
    public BaseParlor decorate() {
        this.builder.buildTV();
        this.builder.buildWall();
        this.builder.buildSofa();
        return this.builder.getResult();
    }

    //精装安排
    public BaseParlor fullDecorate() {
        //必须先装好墙
        this.builder.buildWall();
        //再装好电视
        this.builder.buildTV();
        //最后再装沙发
        this.builder.buildSofa();
        return this.builder.getResult();
    }
}
